import { createApp } from "vue"
// import { createPinia } from "pinia"

import App from "./App.vue"
import router from "./router"

// 引入模板的全局样式
import "@/styles/index.scss"

// 导入svg
import "virtual:svg-icons-register"

// 引入全局组件插件
import globalComponent from "@/components"

import * as ElementPlusIconsVue from "@element-plus/icons-vue"

import pinia from "./stores"

// 引入路由鉴权文件
import "@/permission"

// 测试mock接口是否可用
// import axios from "axios"
// axios({
//   url:'/api/user/login',
//   method:"post",
//   data:{
//     username:'admin',
//     password:'113111'
//   }
// })

const app = createApp(App)

// 注册elemen-plus所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(globalComponent)

// app.use(createPinia())
app.use(pinia)
app.use(router)

app.mount("#app")
// 可通过import.meta.env获取环境变量
// console.log(import.meta.env)
